// https://nuxt.com/docs/api/configuration/nuxt-config
import fs from 'node:fs'
import path from 'node:path'
export default defineNuxtConfig({
  app: {
    head: {
      // 标题
      title: "自由极客",
      meta: [
        // 重点信息描述
        { name: "description", content: "自由极客项目的重点信息描述--" },
        // 项目关键词
        { name: "keywords", content: "自由极客项目关键词" },
      ],
    },
    baseURL: "/"
  },
  devtools: { enabled: true },
  vite: {
    server: {
      cors: true,
      proxy: {
        "/api": {
          target: "http://338116ilpx21.vicp.fun/api",
          changeOrigin: true,
          rewrite: (path) => path.replace(/^\/api/, ""),
        },
      },
    },
  },
  runtimeConfig: {
    public: {
      baseUrl: process.env.DEV_API_BASE
    },
  },
  // 模块配置
  modules: [
    "@element-plus/nuxt",
    "@pinia/nuxt",
    "@nuxtjs/tailwindcss",
  ],
  // 组件自动导入
  components: true,
  // 指定源代码目录
  srcDir: '.',
});
